# include <stdio.h>

void firstReport();
void secondReport();
void thirdReport();

int main() {
    firstReport();
    secondReport();
    thirdReport();
    return 0;
}

void firstReport() {
    int a = 5, b = 5, *p;
    p=&a;
    printf("%d ,%ud\n",a, p);
    *p = 8;
    printf("%d ,%ud\n",a, p);
    p = &b;
    printf("%d ,%ud\n",a, p);
    b = 10;
    printf("%d ,%ud\n",a, p);
}

void secondReport() {
    int i, *p, s=0, a[5]={5, 6, 7, 8, 9};
    p = a;
    for(i = 0; i < 5; i ++, p ++)
    s += *p;
    printf("s = %d\n", s);
}

void thirdReport() {
    const int N = 10;
    int i;
    double list[N], tmp;
    double *pList = &list[0];
    printf("Enter 10 nums:\t");
    for(i = 0; i < N; i ++)
        scanf("%lf", (pList + i));
    getchar();
    for(i = 0; i < N / 2; i ++) {
        tmp = *(pList + i);
        *(pList + i) = *(pList + N - i - 1);
        *(pList + N - i - 1) = tmp;
    }
    printf("The list is:\t[");
    for(i = 0; i < N; i ++)
        printf("%lf, ", *(pList + i));
    printf("]\n");
}
